/*
 * @Author: your name
 * @Date: 2021-09-14 23:22:45
 * @LastEditors: your name
 * @LastEditTime: 2021-09-15 16:44:23
 * @Description: file content
 */
import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'

const routes = [{
        path: '/',
        redirect: '/home',
    },
    {
        // 首页  各种公告课程页  使用element-plus 走马灯组件
        path: '/home',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        // 登录页面  页面中提供通往注册页面的通道
        path: '/login',
        name: 'Login',
        component: null,
    },
    {
        // 注册页面 注册成功之后自动跳转登录页面 
        path: '/signup',
        name: 'SignUp',
    },
    {
        // 用户页面  关于用户信息  学生选课  教师教学班信息
        path: '/user',
        name: 'User',
    },
    {
        // 私聊页面  显示查找用户ID  聊天记录框
        path: '/comment',
        name: 'Comment',
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router